<xsl:stylesheet version="2.0"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:w="http://daimi.au.dk/dWebTek/WikiXML"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" indent="yes" 
	    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
  <xsl:template match="w:wiki">
	<html>
		<head>
			<title>
				<xsl:value-of select="@name"/>
			</title>
			<link rel="stylesheet" href="style_read.css" type="text/css" />
		</head>
		<body>
			<div class='menu'>
				<h1><a href="Read"><img src="littlelion.png" align="left"/></a><xsl:value-of select="@name"/></h1>
				<div class="wikiservername" name="wikiserver">Wiki Server:-</div>
			</div>
			<div class="content">
		        <xsl:apply-templates select="w:*"/>
			</div>
			<div class='rmenu'>
					<h2>Wikipages on the Server</h2>
					<div name="wordlist">
					</div>
					<h2>Related wikipages:</h2>
					<ul>
						<li><a href="Read?word={@name}"><xsl:value-of select="@name" /></a></li>
						<xsl:apply-templates select="w:wikilink" mode="linklist"/>
					</ul>
					<h2>Navigate:</h2>
					<div>
					<ul>
						<li><a name="test"></a></li>
						<li><a href="Entry">Entry</a></li>
						<li><a href="Delete?word={@name}">Delete</a></li>
					</ul>
					<h2>Create new Wikipage</h2>
					<form method="GET" action="Edit">
						<input type="text" name="word"/>
						<input type="submit" value="go"/>
					</form>
					</div>
			</div>
		</body>
		</html>
  </xsl:template>

  <xsl:template match="w:image">
    <img src="{@url}" alt="{@url}"/>
  </xsl:template>
  <xsl:template match="w:wikilink">
	<xsl:if test="@wiki">
		<a href="{concat('Read?wiki=',@wiki,'&amp;word=',@word)}"><xsl:value-of select="@word"/></a>
	</xsl:if>
	<xsl:if test="not(@wiki)">
		<a href="{concat('Read?word=',@word)}"><xsl:value-of select="@word"/></a>
	</xsl:if>
  </xsl:template>
  <xsl:template match="w:wikilink" mode="linklist">
	<li>
		<xsl:if test="@wiki">
			<a href="{concat('Read?wiki=',@wiki,'&amp;word=',@word)}"><xsl:value-of select="@word"/></a>
		</xsl:if>
		<xsl:if test="not(@wiki)">
			<a href="{concat('Read?word=',@word)}"><xsl:value-of select="@word"/></a>
		</xsl:if>
	</li>
  </xsl:template>
  <xsl:template match="w:link">
    <a href="{@url}">
      <xsl:value-of select="@word"/>
    </a>
  </xsl:template>
  <xsl:template match="w:italics">
    <i>
      <xsl:apply-templates select="w:*"/>
    </i>
  </xsl:template>
  <xsl:template match="w:tt">
    <tt>
      <xsl:apply-templates select="w:*"/>
    </tt>
  </xsl:template>
  <xsl:template match="w:bold">
    <b>
      <xsl:apply-templates select="w:*"/>
    </b>
  </xsl:template>
  <xsl:template match="w:header">
    <h1>
      <xsl:apply-templates select="w:*"/>
    </h1>
  </xsl:template>
  <xsl:template match="w:rule">
    <hr />
  </xsl:template>
  <xsl:template match="w:character">
    <xsl:value-of select="@entity"/>
  </xsl:template>
  <xsl:template match="w:list">
    <ul>
      <xsl:apply-templates select="w:*"/>
    </ul>
  </xsl:template>
  <xsl:template match="w:item">
    <li>
      <xsl:apply-templates select="w:*"/>
    </li>
  </xsl:template>
  <xsl:template match="w:br">
    <br />
  </xsl:template>
  <xsl:template match="w:word">
    <xsl:value-of select="."/>
  </xsl:template>
  <xsl:template match="w:ws">
    <xsl:text> </xsl:text>
  </xsl:template>

</xsl:stylesheet>
